﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Framework.MVC;
using FrontCenter.Models;

namespace FrontCenter.Controllers
{
    public class ActivationController : AsyncControllerBase
    {
        #region Field

        private const string m_resource = "vc00";

        #endregion Field


        #region New

        public void NewAsync(string code, string name, string verifycode, string verifyvalue)
        {
            HttpCookie verifycodeCookies = Request.Cookies[m_resource];
            ActivationModel model = new ActivationModel
            {
                ActivationCode=code,
                AccountName = name,
                Resource = m_resource,
                VerifyCode = verifycodeCookies != null ? verifycodeCookies.Value : verifycode,
                VerifyValue = verifyvalue,
            };

            InitModel(model);
        }

        public ActionResult NewCompleted(bool result,string error)
        {
            return result ? Json(result) : Json(error);
        }

        #endregion New

    }
}
